package com.example.demo.vo

import com.example.demo.dbmodels.TJzrDept
import io.swagger.annotations.ApiModelProperty

class DeptVo {

    @ApiModelProperty("科室ID")
    var ID: Int = 0

    @ApiModelProperty("科室代码")
    var DEPT_CODE: String = ""

    @ApiModelProperty("科室名称")
    var DEPT_NAME: String = ""

    @ApiModelProperty("科室别名")
    var DEPT_ALIAS: String = ""

    @ApiModelProperty("科室英文名")
    var DEPT_ENAME: String = ""

    @ApiModelProperty("拼音码")
    var PINYIN: String = ""

    @ApiModelProperty("科室类型")
    var DEPT_TYPE: String = ""

    @ApiModelProperty("简介")
    var DEPT_INTRO: String = ""

    @ApiModelProperty("是否核算科室 0-假； 1-真;")
    var TATDEPT_FLAG: Int = 0

    @ApiModelProperty("是否挂号科室;0-假； 1-真;")
    var REGDEPT_FLAG: Int = 0

    @ApiModelProperty("特殊科室属性0 普通, 1 手术,  2 麻醉, 3 ICU,  4 CCU, C 产科,E急诊留观,T")
    var DEPT_PRO: Int = 0

    @ApiModelProperty("有效性标志;1在用 0 停用 2 废弃")
    var DEPT_STATUS: Int = 0

    @ApiModelProperty("科室负责人")
    var DEPT_PRINCIPAL: String = ""

    @ApiModelProperty("科室电话")
    var DEPT_PHONE: String = ""

    @ApiModelProperty("备注")
    var DEPT_REMARK: String = ""


    fun getVo(table: TJzrDept): DeptVo {
        table.let {
            val data = DeptVo()
            data.ID = it.ID
            data.DEPT_ALIAS = it.DEPT_ALIAS
            data.DEPT_CODE = it.DEPT_CODE
            data.DEPT_ENAME = it.DEPT_ENAME
            data.DEPT_INTRO = it.DEPT_INTRO
            data.DEPT_NAME = it.DEPT_NAME
            data.DEPT_PHONE = it.DEPT_PHONE
            data.DEPT_PRINCIPAL = it.DEPT_PRINCIPAL
//            data.DEPT_PRO = it.DEPT_PRO
            data.DEPT_REMARK = it.DEPT_REMARK
//            data.DEPT_STATUS = it.DEPT_STATUS
            data.DEPT_TYPE = it.DEPT_TYPE
            data.PINYIN = it.PINYIN
//            data.REGDEPT_FLAG = it.REGDEPT_FLAG
//            data.TATDEPT_FLAG = it.TATDEPT_FLAG
            return data
        }
    }

    fun getListVo(table: List<TJzrDept>): List<DeptVo> {
        table.let {
            val deptVos = mutableListOf<DeptVo>()
            table.forEach {
                val data = DeptVo()
                data.ID = it.ID
                data.DEPT_ALIAS = it.DEPT_ALIAS
                data.DEPT_CODE = it.DEPT_CODE
                data.DEPT_ENAME = it.DEPT_ENAME
                data.DEPT_INTRO = it.DEPT_INTRO
                data.DEPT_NAME = it.DEPT_NAME
                data.DEPT_PHONE = it.DEPT_PHONE
                data.DEPT_PRINCIPAL = it.DEPT_PRINCIPAL
//                data.DEPT_PRO = it.DEPT_PRO
                data.DEPT_REMARK = it.DEPT_REMARK
//                data.DEPT_STATUS = it.DEPT_STATUS
                data.DEPT_TYPE = it.DEPT_TYPE
                data.PINYIN = it.PINYIN
//                data.REGDEPT_FLAG = it.REGDEPT_FLAG
//                data.TATDEPT_FLAG = it.TATDEPT_FLAG
                deptVos.add(data)
            }
            return deptVos
        }
    }
}